import React from "react";
<<<<<<< HEAD
import StoFilter from "../components/StoFilter/StoFilter";
import { getStudents } from "../common/mockdata";

const students = getStudents(1);

const filters = [
  {
    type: "text",
    placeholder: "请输入用芳名",
    key: "name",
  },

  {
    type: "select",
    options: ["男", "女", "死变态", "二椅子"],
    placeholder: "请选择性别",
    key: "gender",
  },

  {
    type: "number",
    placeholder: "年龄",
    key: "age",
  },
];

const onReset = () => {
  console.log("用户点击了重置");
};

const onSearchResult = (filteredData: Record<string, any>[]) => {
  console.log("用户点击了搜索", filteredData);
=======

import StoFilter, { FilterType } from "../components/StoFilter";
import { getStudents } from "../common/mockdata";

const students = getStudents(2);

const filters = [
  {
    type: FilterType.TYPE_STRING,
    key: "name",
    placeholder: "请输入用户姓名",
  },

  {
    type: FilterType.TYPE_SELECT,
    key: "gender",
    placeholder: "性别",
    options: ["男", "女", "死变态"],
  },

  {
    type: FilterType.TYPE_NUMBER,
    key: "score",
    placeholder: "分数",
  },
];

const onDataFiltered = (newArr: Record<string, any>[]) => {
  console.log("onFiltered", newArr);
>>>>>>> dev-rollup
};

export default function FilterDemo() {
  return (
<<<<<<< HEAD
    <div style={{ width: 1000 }}>
      <h3>FilterDemo</h3>

      <StoFilter
        data={students}
        filters={filters}
        onReset={onReset}
        onSearchResult={onSearchResult}
=======
    <div>
      <h3>FilterDemo</h3>
      <StoFilter
        width={800}
        filters={filters}
        dataArr={students}
        onDataFiltered={onDataFiltered}
>>>>>>> dev-rollup
      ></StoFilter>
    </div>
  );
}
